#include "multiplexer.h"
using namespace yhaida;
namespace{
    static const uint16_t kClientPort=3333;
    static const char *backendIp="127.0.0.1";
    static const uint16_t kBackendPort=9999;
}


int main(int argc, char* argv[])
{
  LOG_INFO << "pid = " << getpid() << ", tid = " << CurrentThread::tid();
  int numThreads = 4;
  if (argc > 1)
  {
    numThreads = atoi(argv[1]);
  }
  EventLoop loop;
  InetAddress listenAddr(kClientPort);//3333
  InetAddress backendAddr(backendIp, kBackendPort);//127.0.0.1 9999
  MultiplexServer server(&loop, listenAddr, backendAddr, numThreads);

  server.start();

  loop.loop();
}